// Name: map.js
// Description: Construct a google map centered
// at San Diego, CA in the #map container of an html
// document.
// Written by:  Tanya L. Crenshaw
// Modified by: Ailes, Alraddadi, Jorgensen, Mercer

function mapSetup(){
	// Initialize map information
	
	//Get user input for width, height
	var widthIn = prompt("Enter a map width in pixels", "500");
	var heightIn = prompt("Enter a map height in pixels", "400");
	document.getElementById("map").style.width = widthIn + "px";
	document.getElementById("map").style.height = heightIn + "px";
	
	// The center point of the map is San Diego, CA
    var latlng = getZipCodeCenter();

    var myOptions = {
      zoom: 10,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
	 
    };
           
    // Draw the map using the options defined above.
    var map = new google.maps.Map(document.getElementById("map"),
        myOptions);
            
	// Create a marker at the initial center position of the map.
	// The "title" is what is displayed when the user hovers over 
	// the marker.  This is called a Google Maps "tooltip".
	var marker = new google.maps.Marker({
		  position: latlng, 
		  map: map, 
		  title:"San Diego, CA"
	   });
	// Create the polygon that outlines zipcode 97303
	// Call the function constructZipCodeArray() to 
	// get the path of geopgraphical points.
		zipCodeArea = new google.maps.Polygon({
		paths: constructZipCodeArray(),
		strokeColor: "#333y",
		strokeOpacity: 0.8,
		strokeWeight: 2,
		fillColor: "#FF0000",
		fillOpacity: 0.35
    });
	

	// Draw the polygon on the map.
	zipCodeArea.setMap(map);

    
}    